package one.stand.service.impl;

import lombok.extern.slf4j.Slf4j;
import one.stand.enums.GlobalTypeEnums;
import one.stand.model.GlobalConfigurationModel;
import one.stand.model.ResultModel;
import one.stand.response.InitialResponse;
import one.stand.service.InitialService;
import org.springframework.stereotype.Service;

/**
 * @author: QIK
 * @CreateDate: 2019/6/14 11:34
 */
@Slf4j
@Service
public class InitialServiceImpl extends PublicBaseService implements InitialService {

    @Override
    public ResultModel<InitialResponse> initial() {
        log.info("获取初始数据。。。。。。");
        InitialResponse response=new InitialResponse();
        GlobalConfigurationModel globalConfigurationModel=globalConfigurationMapper.select(new GlobalConfigurationModel(){{
            setGlobalKey(globalConfig.getIs_get_phone());
            setGlobalType(GlobalTypeEnums.SERVICE.getCode());
        }});
        if(null!=globalConfigurationModel){
            response.setIsGetPhone(globalConfigurationModel.getGlobalValue());
        }
        return ResultModel.success(response);
    }
}
